package com.tbs.parkingsaleapp.UI.Listenners;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.hardware.Camera;
import android.widget.Toast;
import com.tbs.parkingsaleapp.MainActivity;
import com.tbs.parkingsaleapp.UI.FaceTakeActivity;

public class CamaraTakePicListenner implements Camera.PictureCallback {

    Context mcon;
    public CamaraTakePicListenner(Context c)
    {
        mcon=c;
    }
    @Override
    public void onPictureTaken(byte[] bytes, Camera camera) {
        //camera.startPreview();
        FaceTakeActivity.safeToTakePicture=true;
        Activity activity= (Activity)mcon;
        Intent result=new Intent();
        result.putExtra(FaceTakeActivity.ResultName,bytes);
        activity.setResult(FaceTakeActivity.SUCCESS,result);
        activity.finish();
    }
}
